package utils

import (
	"math/rand"
	"time"
)

func RandCost() int32 {
	rand.Seed(time.Now().UnixNano())
	n := rand.Int31n(31)
	if n < 4 {
		n += 4
	}
	return n
}

func RandStr(length int) string {
	var letter = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
	signs := make([]rune, length)

	for i := range signs {
		signs[i] = letter[rand.Intn(len(letter))]
	}
	return string(signs)
}
